package org.sample.springbootactivemq.queue;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

@Component
public class MessageSender {

	private static final Logger LOGGER = LoggerFactory.getLogger(MessageSender.class);

	@Autowired
	private JmsTemplate jmsTemplate;

	public void send(String message) {
		jmsTemplate.convertAndSend("textQueue", message);
		LOGGER.info("Sent text: {}", message);
	}

}
